modelstring(x)
modelstring(x, debug = FALSE) <- valuemodel2network(string, ordering = NULL, debug = FALSE)
## S3 method for class 'bn':
as.character(x, ...)
## S3 method for class 'character':
as.bn(x)
bn
. modelstring
(but not its
replacement form) accepts also objects of class bn.fit
.bn
object.
If NULL
the nodes are sorted alphabetically.string
.TRUE
a lot of debugging output
is printed; otherwise the function is completely silent.model2network
and as.bn
return an object of
class bn
; modelstring
and as.character.bn
return
a character string.modelstring
have the same format as
the ones returned by the modelstring
function in package
model2network
function).data(learning.test)
res = set.arc(gs(learning.test), "A", "B")
res
modelstring(res)
res2 = model2network(modelstring(res))
res2
all.equal(res, res2)
Run the code above in your browser using DataLab